Skip to content

Conversation

@xuzhg
Copy link
Member

@xuzhg xuzhg commented Apr 23, 2025

Enable minimal API OData.

Fixes #578

Minimal APIs are a simplified approach for building fast HTTP APIs with ASP.NET Core. You can build fully functioning REST endpoints with minimal code and configuration. Skip traditional scaffolding and avoid unnecessary controllers by fluently declaring API routes and actions. For example, the following code creates an API at the root of the web app that returns the text, "Hello World!".

var app = WebApplication.Create(args);
app.MapGet("/", () => "Hello World!");
app.Run();

Customer want to get the OData query options functionalities. We can provide couple solutions

  1. Get OData JSON payload for minimal API

  2. Enable customer to apply OData query to IQueryable explicitly.

  3. Enable customers to apply OData query to IQueryable implicitly.

@WanjohiSammy
Copy link
Member

Looks good to me. Waiting for the first preview

WanjohiSammy
WanjohiSammy previously approved these changes May 8, 2025
@mguinness
Copy link

Looks good to me. Waiting for the first preview

While we wait for the preview on NuGet, the nightly versions are available on MyGet

https://www.myget.org/feed/webapinetcore/package/nuget/Microsoft.AspNetCore.OData

@jamers99
Copy link

I think a huge need for this is to support AoT compilation. According to the support docs MVC is not supported, I'm assuming due to its reliance on Reflection. Will this enable usage of OData with Native AOT?

@habbes
Copy link
Contributor

habbes commented May 15, 2025

@jamers99 AOT support is something we have plan to evaluate. We also have a lot of reflection in various OData libraries.

@xuzhg xuzhg merged commit fb45c0f into main May 19, 2025
1 check passed
ArnaudB88 added a commit to ArnaudB88/OData2Linq that referenced this pull request Jul 16, 2025
* Migrate to ESRP v5 (OData#1421)

* Migrate to ESRP v5

* Replace raw resource identifiers with variables

* Fix typo in KV variable

* Add Obsolete attribute to EdmDeltaResourceObject and
EdmDeltaComplexObject type

* Fix regression causing navigation properties to be auto-expanded in typeless scenarios (OData#1424)

* Bump version to 9.2.1 (OData#1437)

* Fix an issue where multiple flags are set and ensure correct deserialization (OData#1442)

* Fixes OData#1455 Add ISearchQueryValidator (OData#1456)

* Restructure AggregationBinder and ComputeBinder for extensibility (port OData#1378) (OData#1457)

* Bump version to 9.3.0 (OData#1464)

* Fix the typo of generaticType

* Fixes OData#580 Change PageResult<T> property names on serialization

* Fixes OData#1472: Custom ISearchBinder does not support deeply nested $expand (OData#1474)

* Fixes OData#1472: Custom ISearchBinder does not support deeply nested $expand

* Address the comments.

* Ensuring Url safe string key values. Aligning with ODL Client. Fixes OData#1390. (OData#1396)

* CA2254 fixes possible formatting errors

* bump to release version 9.3.1

* Enable minimal API OData (OData#1469)

* Enable minimal API OData

* Simple exclude the metadata and servicedocument reault out from the filter.

* add content-type into response header

* Enable Delta<T> as parameter

* update the comments and public api

* Bump to version 9.4.0 preview

* Fixes OData#1483: Regression with computed in $orderby with 'Could not find a property named xxx on ....' (OData#1486)

* Fixes OData#1483: Regression with computed in $orderby with 'Could not find a property named xxx on ....'

* Bump version to 9.3.2

* Fixes OData#1487 : Minimal API TimeZoneInfo for Serialization (OData#1488)

* Fixes OData#1487 : Minimal API TimeZoneInfo for Serialization
minimalApi

Enable ODataActionParameter and ODataUntypedActionParameter binding

* Address the comment to move the error messge to Resources

* Resolve the issue with IAsyncEnumerable (OData#1467)

* Resolve the issue with IAsyncEnumerable

* Resolve FormatException by escaping curly brackets and add tests for SRResources (OData#1475)

* Fix vulnerable dependencies in newtonsoft.json (OData#1489)

* Fix vulnerable dependencies
* Replace Microsoft.CodeAnalysis.FxCopAnalyzers with Microsoft.CodeAnalysis.NetAnalyzers

* Fixes OData#1494: Enable DeltaSet<T> for minimal API parameter binding
ArnaudB88 added a commit to ArnaudB88/OData2Linq that referenced this pull request Jul 16, 2025
* bump version

* Update reference to ASP.NET Core OData v9.3.2 (#7)

* Migrate to ESRP v5 (OData#1421)

* Migrate to ESRP v5

* Replace raw resource identifiers with variables

* Fix typo in KV variable

* Add Obsolete attribute to EdmDeltaResourceObject and
EdmDeltaComplexObject type

* Fix regression causing navigation properties to be auto-expanded in typeless scenarios (OData#1424)

* Bump version to 9.2.1 (OData#1437)

* Fix an issue where multiple flags are set and ensure correct deserialization (OData#1442)

* Fixes OData#1455 Add ISearchQueryValidator (OData#1456)

* Restructure AggregationBinder and ComputeBinder for extensibility (port OData#1378) (OData#1457)

* Bump version to 9.3.0 (OData#1464)

* Fix the typo of generaticType

* Fixes OData#580 Change PageResult<T> property names on serialization

* Fixes OData#1472: Custom ISearchBinder does not support deeply nested $expand (OData#1474)

* Fixes OData#1472: Custom ISearchBinder does not support deeply nested $expand

* Address the comments.

* Ensuring Url safe string key values. Aligning with ODL Client. Fixes OData#1390. (OData#1396)

* CA2254 fixes possible formatting errors

* bump to release version 9.3.1

* Enable minimal API OData (OData#1469)

* Enable minimal API OData

* Simple exclude the metadata and servicedocument reault out from the filter.

* add content-type into response header

* Enable Delta<T> as parameter

* update the comments and public api

* Bump to version 9.4.0 preview

* Fixes OData#1483: Regression with computed in $orderby with 'Could not find a property named xxx on ....' (OData#1486)

* Fixes OData#1483: Regression with computed in $orderby with 'Could not find a property named xxx on ....'

* Bump version to 9.3.2

* Fixes OData#1487 : Minimal API TimeZoneInfo for Serialization (OData#1488)

* Fixes OData#1487 : Minimal API TimeZoneInfo for Serialization
minimalApi

Enable ODataActionParameter and ODataUntypedActionParameter binding

* Address the comment to move the error messge to Resources

* Resolve the issue with IAsyncEnumerable (OData#1467)

* Resolve the issue with IAsyncEnumerable

* Resolve FormatException by escaping curly brackets and add tests for SRResources (OData#1475)

* Fix vulnerable dependencies in newtonsoft.json (OData#1489)

* Fix vulnerable dependencies
* Replace Microsoft.CodeAnalysis.FxCopAnalyzers with Microsoft.CodeAnalysis.NetAnalyzers

* Fixes OData#1494: Enable DeltaSet<T> for minimal API parameter binding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ASP.NET Core OData 8.x does not work with Minimal API

6 participants